<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增系统定义')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-sys-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required" title="唯一标识一个系统的代码。只能由英文字母、数字、下划线、短横线、小数点组成。">系统代码：</label>
                <div class="col-sm-8">
                    <input name="sysCode" class="form-control" type="text" required placeholder="系统代码">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">系统名称：</label>
                <div class="col-sm-8">
                    <input name="sysName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">系统简称：</label>
                <div class="col-sm-8">
                    <input name="sysShortName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">系统类型：</label>
                <div class="col-sm-8">
                    <select name="sysType" class="form-control m-b" th:with="type=${@dict.getType('trans_sys_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "metadata/sys"
        
        $("#form-sys-add").validate({
           	onkeyup: false,
        	rules:{
        		sysCode:{
        			codeRule: true
        		}
        	},
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-sys-add').serialize());
            }
        }
    </script>
</body>
</html>